
$NG.AllReady(function (page, { useAction, useBeforeClick, useValuesChange, useClick, useUpdateRow, subscribe, useUpdateRows }) {
    var mstform = $NG.getCmpApi('p_form_fzjgbasp_m');
    console.log(mstform);
    useValuesChange(({ args }) => {
        console.log(mstform.getItem('u_ejba').getValue());
        if (mstform.getItem('u_ejba').getValue() == '02') {
            $NG.updateUI((updater) => {
                const fields = ["u_sjba", "u_bzjl", "u_sqrq", 'u_dd'];
                fields.forEach((field) => {
                    updater.fieldSetForm.p_form_fzjgbasp_m[field].setProps({
                        hidden: true, //隐藏
                        required: false, //必输
                        // disabled: true, //只读
                    });
                });
            });
            $NG.updateUI((updater) => {
                const fields = ["u_gs", "u_wzmc", "u_wzdz", "u_yhm", "u_mm", "u_sfxymms"];
                fields.forEach((field) => {
                    updater.fieldSetForm.p_form_fzjgbasp_m[field].setProps({
                        hidden: false, //隐藏
                        required: true, //必输
                        // disabled: true, //只读
                    });
                });
            });
        } else if (mstform.getItem('u_ejba').getValue() == '01') {
            $NG.updateUI((updater) => {
                const fields = ["u_sjba", "u_bzjl", "u_sqrq", 'u_dd'];
                fields.forEach((field) => {
                    updater.fieldSetForm.p_form_fzjgbasp_m[field].setProps({
                        hidden: false, //隐藏
                        required: true, //必输
                        // disabled: true, //只读
                    });
                });
            });
            $NG.updateUI((updater) => {
                const fields = ["u_gs", "u_wzmc", "u_wzdz", "u_yhm", "u_mm", "u_sfxymms"];
                fields.forEach((field) => {
                    updater.fieldSetForm.p_form_fzjgbasp_m[field].setProps({
                        hidden: true, //隐藏
                        required: false, //必输
                        // disabled: true, //只读
                    });
                });
            });
        }
        // console.log(args, "u_ywlb");
    }, "p_form_fzjgbasp_m.u_ejba");
    mx()
    function mx() {
        if (mstform.getItem('u_xz').getValue() == 6870000000000152) {
            $NG
                .getCompMap()
                .get("__Tabs__")[0]
                .getApi()
                .updateItems((innerItems, activeKey) => {
                    return [...innerItems.filter((item) => item.key !== "1")];
                });
        } else {
            $NG
                .getCompMap()
                .get("__Tabs__")[0]
                .getApi()
                .updateItems((innerItems, activeKey) => {
                    return [...innerItems.filter((item) => item.key == "1")];
                });
        }
    }
    useValuesChange(({ args }) => {
        mx()
        console.log(mstform.getItem('u_xz').getValue());
        if (mstform.getItem('u_xz').getValue() == 6870000000000150) {
            $NG.updateUI((updater) => {
                const fields = ["u_ssdw", "u_ejba", "u_sfjbtbtj", "u_yxq"];
                fields.forEach((field) => {
                    updater.fieldSetForm.p_form_fzjgbasp_m[field].setProps({
                        hidden: false, //隐藏
                        required: true, //必输
                        // disabled: true, //只读
                    });
                });
            });
            $NG.updateUI((updater) => {
                const fields = ["u_fgsjl", "u_zt", "u_clrq", "u_zd", 'u_cl', 'u_fzr', 'u_gjdbcjl'];
                fields.forEach((field) => {
                    updater.fieldSetForm.p_form_fzjgbasp_m[field].setProps({
                        hidden: true, //隐藏
                        required: false, //必输
                        // disabled: true, //只读
                    });
                });
            });

        } else if (mstform.getItem('u_xz').getValue() == 6870000000000151) {

            $NG.updateUI((updater) => {
                const fields = ["u_clrq", "u_ssdw", "u_fgsjl", "u_zt", "u_sfjbtbtj", "u_yxq"];
                fields.forEach((field) => {
                    updater.fieldSetForm.p_form_fzjgbasp_m[field].setProps({
                        hidden: false, //隐藏
                        required: true, //必输
                        // disabled: true, //只读
                    });
                });
            });
            $NG.updateUI((updater) => {
                const fields = ["u_zd", 'u_cl', 'u_fzr', 'u_gjdbcjl', "u_ejba", "u_gs", "u_wzmc", "u_wzdz", "u_yhm", "u_mm", "u_sfxymms", "u_sjba", "u_bzjl", "u_sqrq"];
                fields.forEach((field) => {
                    updater.fieldSetForm.p_form_fzjgbasp_m[field].setProps({
                        hidden: true, //隐藏
                        required: false, //必输
                        // disabled: true, //只读
                    });
                });
            });
        } else if (mstform.getItem('u_xz').getValue() == 6870000000000152) {

            $NG.updateUI((updater) => {
                const fields = ["u_ssdw", "u_zd", "u_cl", "u_fzr", "u_clrq", 'u_dd'];
                fields.forEach((field) => {
                    updater.fieldSetForm.p_form_fzjgbasp_m[field].setProps({
                        hidden: false, //隐藏
                        required: true, //必输
                        // disabled: true, //只读
                    });
                });
            });
            $NG.updateUI((updater) => {
                const fields = ['u_gjdbcjl', "u_ejba", "u_gs", "u_wzmc", "u_wzdz", "u_yhm", "u_mm", "u_sfxymms", "u_sjba", "u_bzjl", "u_sqrq", 'u_fgsjl', "u_sfjbtbtj", "u_yxq"];
                fields.forEach((field) => {
                    updater.fieldSetForm.p_form_fzjgbasp_m[field].setProps({
                        hidden: true, //隐藏
                        required: false, //必输
                        // disabled: true, //只读
                    });
                });
            });
        } else if (mstform.getItem('u_xz').getValue() == 6870000000000153) {

            $NG.updateUI((updater) => {
                const fields = ["u_ssdw", "u_gjdbcjl", "u_sqrq", "u_sfjbtbtj", "u_yxq"];
                fields.forEach((field) => {
                    updater.fieldSetForm.p_form_fzjgbasp_m[field].setProps({
                        hidden: false, //隐藏
                        required: true, //必输
                        // disabled: true, //只读
                    });
                });
            });
            $NG.updateUI((updater) => {
                const fields = ["u_ejba", "u_gs", "u_wzmc", "u_wzdz", "u_yhm", "u_mm", "u_sfxymms", "u_sjba", "u_bzjl", 'u_fgsjl', "u_zd", "u_cl", "u_fzr", "u_clrq", "u_zt"];
                fields.forEach((field) => {
                    updater.fieldSetForm.p_form_fzjgbasp_m[field].setProps({
                        hidden: true, //隐藏
                        required: false, //必输
                        // disabled: true, //只读
                    });
                });
            });
        }
        // console.log(args, "u_ywlb");
    }, "p_form_fzjgbasp_m.u_xz");

}, function () {
    console.log('list Ready');
});

